local skill = fk.CreateSkill{
  name = "anti_magic_shell_skill"
}

Fk:loadTranslationTable{
  [skill.name] = "反魔法护罩",
  ["#anti_magic_shell_skill"] = "选择至多三名座次连续的角色，其隐匿",
}

local TuntianUtil = require "packages/tuntian_studio/utility"

skill:addEffect("cardskill", {
  prompt = "#anti_magic_shell_skill",
  can_use = Util.CanUse,
  min_target_num = 1,
  max_target_num = 3,
  mod_target_filter = function (self, player, to_select, selected, card, extra_data)
    if #selected == 0 then
      return true
    elseif table.find(selected, function (p) return table.contains({p:getNextAlive(false, 1), p:getLastAlive(false, 1)}, to_select) end) then
      return true
    end
  end,
  target_filter = Util.CardTargetFilter,
  on_effect = function(self, room, effect)
    TuntianUtil.enterHidden(effect.to)
  end,
})

return skill